package com.dtw.ditouwang.ui;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.dtw.ditouwang.R;
import com.dtw.ditouwang.beans.EditorChooseBean;
import com.dtw.ditouwang.models.WebApi;
import com.youth.banner.Banner;
import com.youth.banner.loader.ImageLoader;

import java.util.List;

public class PhotoPreviewActivity extends BaseActivity {
    public final static String KeyUrlList = "KeyUrlList";
    List<String> urlList;
    Banner banner;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo_preview);
        banner=findViewById(R.id.banner);
        urlList=getIntent().getStringArrayListExtra(KeyUrlList);
        banner.setImageLoader(new ImageLoader() {
            @Override
            public void displayImage(Context context, Object path, ImageView imageView) {
                Glide.with(imageView).load(WebApi.BaseUrl+((String) path).replace("\\","/")).into(imageView);
            }
        });
        banner.setImages(urlList);
        banner.isAutoPlay(false);
        banner.start();
    }

    public void onClick(View view){
        switch (view.getId()){
            case R.id.image_image:
                finish();
                break;

        }
    }
}
